////////////////////////////////////////////////////////////////////////////////
//                                                                            //
//  Filename:    SlotProbabilityTable.h                                       //
//  Developer:   Tommy Riddle                                                 //
//  Create date: 03/28/2005                                                   //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////
//                                                                            //
//  Description: This is the class declaration for a utility class that       //
//				 manages probability tables.                                  //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////
//        Copyright (c) 2005 - Realtime Gaming.  All rights reserved.         //
////////////////////////////////////////////////////////////////////////////////

#if !defined(__SLOTPROBABILITYTABLE_H__)
#define __SLOTPROBABILITYTABLE_H__

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#pragma warning( disable: 4786 )
#include <vector>

#include "lib.h"

using namespace std;

class SlotProbabilityTable
{
public:
	SlotProbabilityTable( int32 nTableID );

	void addEntry( uint32 nMaxWeightForValue, int32 nValue );

	int32 getRandomValue() const;

	int32 getTableID() const
	{
		return m_nTableID;
	}

	uint32 getMaxWeightForTable() const
	{
		return m_nMaxWeightForTable;
	}

private:
	class SlotProbabilityTableEntry
	{
	public:
		SlotProbabilityTableEntry( uint32 nMaxWeightForValue, int32 nValue )
		{
			m_nMaxWeightForValue = nMaxWeightForValue;
			m_nValue = nValue;
		}

		uint32 m_nMaxWeightForValue;
		int32 m_nValue;
	};

    typedef vector< SlotProbabilityTableEntry > SlotProbabilityTableEntryVector;

    SlotProbabilityTableEntryVector m_vecEntries;
	uint32 m_nMaxWeightForTable;
	int32 m_nTableID;
};

#endif // !defined(__SLOTPROBABILITYTABLE_H__)
